{extend name='admin@main'}

{block name="button"}
<button data-modal='{:url("add")}' data-title="添加链接" class='layui-btn layui-btn-sm layui-btn-primary'>添加链接</button>
<button data-action='{:url("remove")}' data-rule="id#{key}" class='layui-btn layui-btn-sm layui-btn-primary'>删除链接
</button>
{/block}

{block name="content"}
<div class="think-box-shadow">
    {include file='links/index_search'}
    <style>
.link-img{height: 2pc;border-radius: 2pc}
    </style>
    <table class="layui-table margin-top-10" lay-skin="line">
        {notempty name='list'}
        <thead>
        <tr>
            <th class='list-table-check-td think-checkbox'>
                <input data-auto-none data-check-target='.list-check-box' type='checkbox'>
            </th>
            <th class='list-table-sort-td'>
                <button type="button" data-reload class="layui-btn layui-btn-xs">刷 新</button>
            </th>
            <th class='text-left nowrap'>名称</th>
            <th class='text-left nowrap'>分类</th>
            <th class='text-center nowrap'>icon|logo</th>
            <th class='text-left nowrap'>地址</th>
            <th class='text-left'>提示信息</th>
            <th class='text-left nowrap'>创建时间</th>
            <th width="150" class="text-center">操作</th>
        </tr>
        </thead>
        {/notempty}
        <tbody>
        {foreach $list as $key=>$vo}
        <tr>
            <td class='list-table-check-td think-checkbox'>
                <input class="list-check-box" value='{$vo.id}' type='checkbox'>
            </td>
            <td class="list-table-sort-td">
                <input data-action-blur="{:request()->url()}" data-value="id#{$vo.id};action#sort;sort#{value}" data-loading="false" value="{$vo.sort}" class="list-sort-input">
            </td>
            <td class='text-left nowrap'>
                {$vo.name}
            </td>
            <td class='text-left nowrap'>
                {$vo.cate_name}
            </td>
            <td class='text-center nowrap'>
                {if !empty($vo.icon)}
                <i class="{$vo.icon}"></i>
                {else}
                <img class="link-img" src="{$vo.logo}" >
                {/if}
            </td>
            <td class="text-left nowrap">
                <a target="_blank" href="{$vo.href}">{$vo.href}</a>
            </td>
            <td class="text-left">
                {$vo.tips}
            </td>
            <td class='text-left nowrap'>{$vo.create_at|format_datetime}</td>
            <td width="150" class="text-center">
                <a data-title="编辑商品分类" class="layui-btn layui-btn-sm" data-modal='{:url("edit")}?id={$vo.id}'>编 辑</a>
                <a class="layui-btn layui-btn-sm layui-btn-danger" data-confirm="确定要删除数据吗?"
                   data-action="{:url('remove')}" data-value="id#{$vo.id}">删 除</a>
            </td>
        </tr>
        {/foreach}
        </tbody>
    </table>
    {empty name='list'}<span class="notdata">没有记录哦</span>{else}{$pagehtml|raw|default=''}{/empty}
</div>
{/block}
